package com.cxy.usercenter;
import com.cxy.usercenter.dao.user.UserMapper;
import com.cxy.usercenter.domain.entity.user.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author: huayushu luming
 * @date: 2020-11-25 14:47
 * @desc:
 **/
@RestController
@Slf4j
public class TestController {
    @Autowired
    private UserMapper userMapperp;
    @GetMapping("/test")
    public User testInsert(){
        User user=User.builder()
                .avatarUrl("xxx")
                .bonus(100)
                .createTime(new Date())
                .updateTime(new Date())
                .build();
        userMapperp.insertSelective(user);
        return user;
    }

    @GetMapping("/q")
    public User query(User user){
        return user;
    }

}
